<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>
            <if condition="ACTION_NAME eq 'add'">
                新增比赛
            <else/>
                编辑比赛 
            </if>
            <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button>
        </h2>
    </div>

    <div class="tab-wrap">
        <ul class="tab-nav nav nav-tabs">
            <li data-tab="tab1" class="current"><a href="javascript:void(0);">基本</a></li>
            <li data-tab="tab2"><a href="javascript:void(0);">战况</a></li>
        </ul>
    </div>

    <div class="tab-content">
    <form action="" method="post" class="form">
        <div id="tab1" class="tab-pane in tab1">
         <!--   <div class="form-item form-group">
                <label class="item-label">游戏<span class="check-tips"></span></label>
                <div class="controls">
                    <select name="game_id">
                        <option value="">--请选择--</option>
                        <volist name="games" id="game">
                            <option value="{$game.id}" <eq name="game['id']" value="$game_id"> selected</eq>>
                                {$game.name}
                            </option>
                        </volist>
                    </select>
                </div>
            </div> -->

            <div class="form-item form-group">
                <label class="item-label">赛事<span class="check-tips"></span></label>
                <div class="controls">
                    <select name="match_id">
                        <option value="">--请选择--</option>
                        <volist name="matches" id="match">
                            <option value="{$match.id}" <eq name="match['id']" value="$match_id"> selected</eq>>
                                {$match.title}
                            </option>
                        </volist>
                    </select>
                </div>
            </div>

            <div class="form-item form-group">
                <label class="item-label">标题<span class="check-tips"></span></label>
                <div class="controls">
                    <input type="text" class="text input-small form-control" name="title" value="{$title|htmlspecialchars_decode}">
                </div>
            </div>

        <!--    <div class="form-item form-group">
                <label class="item-label">副标题<span class="check-tips"> （短标题，用于APP显示）</span></label>
                <div class="controls">
                    <input type="text" class="text input-small form-control" name="subtitle" value="{$subtitle|htmlspecialchars_decode}">
                </div>
            </div> -->

            <div class="form-item form-group cf">
                <label class="item-label">封面<span class="check-tips">(600*338px png/jpg)</span></label>
                <div class="controls">
                    <div class="controls">
                        <input type="file" id="upload_picture_cover">
                        <input type="hidden" name="cover" id="cover_id_cover" value="{$cover}" />
                        <div class="upload-img-box">
                            <notempty name="cover">
                            <div class="upload-pre-item"><img src="{:url_format($cover)}"/></div>
                            </notempty>
                        </div>
                    </div>
                    {:hook('adminPicUpload', array('id'=>"upload_picture_cover",'return'=>"cover_id_cover", 'type' => 'path'))}                                                              
                </div>
            </div>

            <div class="form-item form-group">
                <label class="item-label">描述<span class="check-tips"></span></label>
                <div class="controls">
                    <label class="input-large">
                        <textarea class="form-control" rows="4" name="detail">{$detail|htmlspecialchars_decode}</textarea>
                    </label>
                </div>
            </div>
            <div class="form-item form-group">
                <label class="item-label">状态<span class="check-tips"></span></label>
                <input type="radio" name="status" <if condition="$status eq 1 or $status eq ''">checked</if> value="1"  /> 开启
                <input type="radio" name="status" <eq name="status" value="0">checked</eq> value="0"  />关闭
            </div>
        </div>
        <div id="tab2" class="tab-pane tab2">
            <div class="form-item form-group">
                <label class="item-label">比赛时间<span class="check-tips"></span></label>
                <div class="controls">
                    <input type="text" class="text input-small form-control time" name="race_time" value="{$race_time}" placeholder="开赛时间">
                </div>
            </div>
            <div class="form-item form-group form-inline">
                <label class="item-label">队伍<span class="check-tips"> ( 填写队伍名称 ) </span></label>
                <div class="controls">
                    队伍1: <input class="text form-control input-small" name="fJoiner" value="{$competitor.0|htmlspecialchars_decode}">
                    VS
                    队伍2: <input class="text form-control input-small" name="sJoiner" value="{$competitor.1|htmlspecialchars_decode}">
                </div>
            </div>
             <div class="form-item form-group">
                <label class="item-label">总比分<span class="check-tips">如:1-1(英文"-")</span></label>
                <div class="controls">
                    <input type="text" class="text form-control input-mini" name="score" value="{$score}">
                </div>
            </div>
            
        </div>

        <div class="form-item form-group">
            <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
            <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
        </div>
    </form>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('RaceGroup/index')}');
        showTab();
        $(function(){
            $('.time').datetimepicker({
                format: 'yyyy-mm-dd hh:ii',
                language:"zh-CN",
                minView:0,
                autoclose:true
            });
        });
       
    </script>
</block>
